#ifndef DP_H
#define DP_H

class DataProprocessing {
private:

	vector<string> baseItemNoDuplicate;
	vector<string> baseItem;
	vector<string> coEle;
	vector<string> coocurred;
	vector<string> it_diffItem2;

	vector<int> coEleCount2;
	vector<int> numericAtt;
	vector<int> cateAtt;
	vector<int> booleanAtt;
	vector<int> coEleCount;

	vector<double> meanBase;

	vector<vector<double>> varNumeric;

	int coEleAtt;
	int baseAtt;
	int maxEle;

	string coElestring;

	ifstream infile;

public:
	DataProprocessing();
	~DataProprocessing();
	vector<vector<string>> readFile(char* filename);
	void writeOutput(vector<vector<string>> memEle);
	void checkAttType(vector<vector<string>> memEle);
	bool checkNumber(const char* val);
	bool checkChar(const char* val);
	bool checkBoolean(const char* val);
	bool checkPatternNumeric(const char s);
	vector<vector<string>> readFileVertically(vector<vector<string>> memEle);
	int findBaseCateAtt(vector<vector<string>> memEle);
	int findMax(vector<int> arrCountEle);
	void buildMatrix(vector<vector<string>> vmemEle,vector<vector<string>>memEle);
	vector<string> DataProprocessing::buildMN(vector<vector<string>> memEle);
	void calculateSimilarity();
	vector<double> readCoStrSim();
	double DataProprocessing::similarityD(string coElestring,int i);
	vector<vector<double>> varianceNumeric(int base,vector<vector<string>> vmemEle,vector<vector<string>> memEle);
	int selectSSw(vector<vector<double>> varNumeric);
	vector<vector<string>> assignMeantoBase(int selected,vector<vector<string>> vmemEle);
	vector<vector<string>> quantifiedFunc(vector<double> sim_vector,vector<vector<string>> vmemEle_doneBase,vector<vector<string>> vmemEle);
	void writeIntoFile(char* outputname, vector<vector<string>> vmemEle_doneAll);
	string writeString(char* filenamePP, string str);
	void clearMemory();
	
};
#endif
